package com.gjy.pd.single;

import java.io.ObjectStreamException;
import java.io.Serializable;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2022-12-15 10:28:30
 */
public class Single4 implements Serializable {

    private static final long serialVersionUID = 1L;

    private Single4() {
        if (InsHolder.INS != null) {
            throw new RuntimeException("不允许实例化多个");
        }
    }

    private static final class InsHolder {
        static final Single4 INS = new Single4();
    }

    public static Single4 getIns() {
        return InsHolder.INS;
    }

    public Object readResolve() throws ObjectStreamException {
        return InsHolder.INS;
    }
}
